home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / EmacsTeX / Emacs-3.0.1 / Source / lisp.elc < prev    next >
Encoding:
Text File  |  1995-06-12  |  28.4 KB  |  523 lines

  1.  
  2. (defvar scrollbar-width 5 "\
  3. *The character width of the scrollbar.
  4. The cursor is deemed to be in the right edge scrollbar if it is this near the
  5. right edge, and more than two chars past the end of the indicated line.
  6. Setting to nil limits the scrollbar to the edge or vertical dividing bar.")
  7.  
  8. (defun make-mousemap nil "\
  9. Returns a new mousemap." (byte-code "ˋ¹BÇ" [nil mousemap] 2))
  10.  
  11. (defun copy-mousemap (mousemap) "\
  12. Return a copy of mousemap." (byte-code "ˋ!Ç" [mousemap copy-alist] 2))
  13.  
  14. (defun define-mouse (mousemap mouse-list def) "\
  15. Args MOUSEMAP, MOUSE-LIST, DEF.  Define MOUSE-LIST in MOUSEMAP as DEF.
  16. MOUSE-LIST is a list of atoms specifing a mouse hit according to these rules:
  17.   * One of these atoms specifies the active region of the definition.
  18.     text, scrollbar, modeline, minibuffer
  19.   * One or two or these atoms specify the button or button combination.
  20.         left, middle, right, double
  21.   * Any combination of these atoms specify the active shift keys.
  22.         control, shift, meta
  23.   * With a single unshifted button, you can add
  24.     up
  25.     to indicate an up-click.
  26. The atom `double' is used with a button designator to denote a double click.
  27. Two button chords are denoted by listing the two buttons.
  28. See eterm-mouse-handler for the treatment of the form DEF." (byte-code "ˆ˜!    
  29. #Ç" [mouse-list mousemap def mousemap-set mouse-list-to-mouse-code] 5))
  30.  
  31. (defun global-set-mouse (mouse-list def) "\
  32. Give MOUSE-EVENT-LIST a local definition of DEF.
  33. See define-mouse for a description of MOUSE-EVENT-LIST and DEF.
  34. Note that if MOUSE-EVENT-LIST has a local definition in the current buffer,
  35. that local definition will continue to shadow any global definition." (interactive "xMouse event: 
  36. xDefinition: ") (byte-code "ˆÈ˜    
  37. #Ç" [current-global-mousemap mouse-list def nil define-mouse] 4))
  38.  
  39. (defun local-set-mouse (mouse-list def) "\
  40. Give MOUSE-EVENT-LIST a local definition of DEF.
  41. See define-mouse for a description of the arguments.
  42. The definition goes in the current buffer's local mousemap.
  43. Normally buffers in the same major mode share a local mousemap." (interactive "xMouse event: 
  44. xDefinition: ") (byte-code "ˆÈ?Ä ˜ Éȯ    
  45. #Ç" [current-local-mousemap mouse-list def nil make-mousemap define-mouse] 5))
  46.  
  47. (defun use-global-mousemap (mousemap) "\
  48. Selects MOUSEMAP as the global mousemap." (byte-code "    ÉÇ" [current-global-mousemap mousemap] 2))
  49.  
  50. (defun use-local-mousemap (mousemap) "\
  51. Selects MOUSEMAP as the local mousemap.
  52. nil for MOUSEMAP means no local mousemap." (byte-code "    ÉÇ" [current-local-mousemap mousemap] 2))
  53.  
  54. (defun logtest (x y) "\
  55. True if any bits set in X are also set in Y.
  56. Just like the Common Lisp function of the same name." (byte-code "´ˆ    \"!?Ç" [x y zerop logand] 4))
  57.  
  58. (defconst em::ButtonBits 7)
  59.  
  60. (defconst em::ShiftmaskBits 56)
  61.  
  62. (defconst em::DoubleBits 64)
  63.  
  64. (defconst em::UpBits 128)
  65.  
  66. (defmacro em::hit-code (hit) (byte-code "ˋ´EÇ" [hit nth 0] 3))
  67.  
  68. (defmacro em::hit-button (hit) (byte-code "ˋ´ˆ˜EEÇ" [hit logand em::ButtonBits nth 0] 5))
  69.  
  70. (defmacro em::hit-shiftmask (hit) (byte-code "ˋ´ˆ˜EEÇ" [hit logand em::ShiftmaskBits nth 0] 5))
  71.  
  72. (defmacro em::hit-double (hit) (byte-code "ˋ´ˆ˜EEÇ" [hit logand em::DoubleBits nth 0] 5))
  73.  
  74. (defmacro em::hit-up (hit) (byte-code "ˋ´ˆ˜EEÇ" [hit logand em::UpBits nth 0] 5))
  75.  
  76. (defmacro em::hit-x (hit) (byte-code "ˋ´EÇ" [hit nth 1] 3))
  77.  
  78. (defmacro em::hit-y (hit) (byte-code "ˋ´EÇ" [hit nth 2] 3))
  79.  
  80. (defmacro em::hit-delta (hit) (byte-code "ˋ´EÇ" [hit nth 3] 3))
  81.  
  82. (defmacro em::hit-up-p (hit) (byte-code "ˋ´ˆDDDÇ" [hit not zerop em::hit-up] 4))
  83.  
  84. (defmacro em::loc-w (loc) (byte-code "ˋ´EÇ" [loc nth 0] 3))
  85.  
  86. (defmacro em::loc-x (loc) (byte-code "ˋ´EÇ" [loc nth 1] 3))
  87.  
  88. (defmacro em::loc-y (loc) (byte-code "ˋ´EÇ" [loc nth 2] 3))
  89.  
  90. (defmacro eval-in-buffer (buffer &rest forms) "Macro to switches to BUFFER, evaluates FORMS, returns to original buffer." (byte-code "´ˆ˜¯˘˙DD    \"¨EEÇ" [buffer forms let ((StartBuffer (current-buffer))) unwind-protect append progn set-buffer (set-buffer StartBuffer)] 7))
  91.  
  92. (put (quote eval-in-buffer) (quote lisp-indent-hook) 1)
  93.  
  94. (defmacro eval-in-window (window &rest forms) "Switch to WINDOW, evaluate FORMS, return to original window." (byte-code "´ˆ˜¯˘˙DD    \"¨EEÇ" [window forms let ((OriginallySelectedWindow (selected-window))) unwind-protect append progn select-window (select-window OriginallySelectedWindow)] 7))
  95.  
  96. (put (quote eval-in-window) (quote lisp-indent-hook) 1)
  97.  
  98. (defmacro eval-in-windows (form &optional yesmini) "Switches to each window and evaluates FORM.  Optional argument
  99. YESMINI says to include the minibuffer as a window.
  100. This is a macro, and does not evaluate its arguments." (byte-code "´ˆ˜¯˘˙¨²˚¸³    EDEDED˝EEÇ" [form yesmini let ((OriginallySelectedWindow (selected-window))) unwind-protect while progn not eq OriginallySelectedWindow select-window next-window nil (select-window OriginallySelectedWindow)] 13))
  101.  
  102. (put (quote eval-in-window) (quote lisp-indent-hook) 0)
  103.  
  104. (defun move-to-loc (x y) "\
  105. Move cursor to window location X, Y.
  106. Handles wrapped and horizontally scrolled lines correctly." (byte-code "˜!Èi¯˘˙ !Âi¨ ²Z ^\\Á\"˚˙ ¸¨ S ^#!
  107.     Z*Ç" [y cc nc x move-to-window-line move-to-column zerop window-hscroll window-width 2 + -1] 13))
  108.  
  109. (defun minibuffer-window-p (window) "\
  110. True iff this WINDOW is minibuffer." (byte-code "ˋ ´ˆ!8UÇ" [window screen-height 3 window-edges] 5))
  111.  
  112. (defun eterm-mouse-handler (&optional hit) "\
  113. Evaluates the function or list associated with a mouse hit.
  114. Expecting to read a hit, which is a list: (button x y unused).  
  115. A form bound to button by define-mouse is found by mouse-lookup. 
  116. The variables: *mouse-window*, *mouse-x*, *mouse-y* are bound.  
  117. If the form is a symbol (symbolp), it is funcall'ed with *mouse-window*,
  118. *mouse-x*, and *mouse-y* as arguments; if the form is a list (listp),
  119. the form is eval'ed; if the form is neither of these, it is an error.
  120. Returns nil." (interactive) (byte-code "³È?Ä ˝ ÉÈ˛ˇ8—8\"±    8ˇ    8—    8¼    \"p½Î¾
  121. !qÈà
  122. !))?ÂVáâ±8\"!??ÄSãäåç
  123. !!\"ÁÄ9ÂlÉ    Èè
  124. $ÁÄ< @É    Èé!ÁÄãê\"),)È    ë=ÄÕ É    È³Ç" [hit loc *mouse-window* *mouse-x* *mouse-y* mouse-code form StartBuffer em::UpBits this-command t last-command nil mouse-hit-read em::window-xy 1 2 0 mouse-event-code ((byte-code "qÇ" [StartBuffer] 1)) window-buffer mouse-lookup zerop logand error "Undefined mouse event: %s" prin1-to-string mouse-code-to-mouse-list funcall eval "Mouse action must be symbol or list, but was: %s" eterm-mouse-handler] 15))
  125.  
  126. (defun mouse-hit-read nil "\
  127. Read mouse-hit list from keyboard.  Like (read 'read-char),
  128. but that uses minibuffer, and mucks up last-command." (byte-code "ˋˋˆ˜rÉ
  129. BÉÈ\"?ÄˋÈÁȯ˘˙¨!²#!*Ç" [char-list nil char equal 13 read mapconcat char-to-string nreverse ""] 7))
  130.  
  131. (defun em::window-xy (x y) "\
  132. Find window containing screen coordinates X and Y.
  133. Returns list (window x y) where x and y are relative to window." (byte-code "ˆ˜ÍÅ
  134. ¹    
  135. EÇ" [nil x y found (byte-code "˚ ¸Î³˚ !˝    8˛    8ˇ    8—    8 ± UÄ% TÉÈ
  136. ¼ UÄ1
  137. TÉÈ
  138. YÄK WÄK YÄK
  139. WÄ\\½¾˚ 
  140. Z ZE\",)Èàᨲ\"!=?Äp¨ÈÁ))Ç" [OriginallySelectedWindow we le te re be x y nil t selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) window-edges 0 1 2 3 screen-width screen-height throw found select-window next-window] 12)] 3))
  141.  
  142. (defun em::window-region (loc) "\
  143. Parse LOC into a region symbol.
  144. Returns one of (text scrollbar modeline minibuffer)" (byte-code "¨    8²    8˚    8¸!S³!S˝! ˛ÁS
  145. YÂ*ˇÁS
  146. YÂ4—ÁSÄK
  147. ZYÄK
  148. ˚±
  149. #\\YÂR—ÁS¼*+Ç" [w loc x y right bottom scrollbar-width t 0 1 2 window-width window-height minibuffer-window-p minibuffer modeline scrollbar window-line-end text] 9))
  150.  
  151. (defun window-line-end (w x y) "\
  152. Return WINDOW column (ignore X) containing end of line Y" (byte-code "ˆ ˜Î¯    !ÈÊ˘˙ 
  153. \")))Ç" [OriginallySelectedWindow w y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window move-to-loc screen-width] 6))
  154.  
  155. (defconst em::keyword-alist (quote ((left . 1) (middle . 2) (right . 4) (shift . 8) (control . 16) (meta . 32) (double . 64) (up . 128) (text . 256) (scrollbar . 512) (modeline . 1024) (minibuffer . 2048))))
  156.  
  157. (defun mouse-event-code (hit loc) "\
  158. Maps MOUSE-HIT and LOC into a mouse-code." (byte-code "´ˆ8˜¯    !!\"Ç" [hit loc logior 0 mouse-region-to-code em::window-region] 5))
  159.  
  160. (defun mouse-region-to-code (region) "\
  161. Returns partial mouse-code for specified REGION." (byte-code "´    \"AÇ" [region em::keyword-alist assq] 3))
  162.  
  163. (defun mouse-list-to-mouse-code (mouse-list) "\
  164. Map a MOUSE-LIST to a mouse-code." (byte-code "ˋ´ˆ˜\"\"Ç" [mouse-list apply logior mapcar (lambda (x) (byte-code "´    \"AÇ" [x em::keyword-alist assq] 3))] 5))
  165.  
  166. (defun mouse-code-to-mouse-list (mouse-code) "\
  167. Map a MOUSE-CODE to a mouse-list." (byte-code "ˋ´ˆ˜\"\"Ç" [em::keyword-alist apply nconc mapcar (lambda (x) (byte-code "´    A\"Ä     @CÇ" [mouse-code x logtest] 3))] 5))
  168.  
  169. (defun mousemap-set (code mousemap value) (byte-code "    A¯ \"
  170. ¢
  171. \"Á˘     BB\"*Ç" [alist mousemap assq-result code value assq setcdr] 6))
  172.  
  173. (defun mousemap-get (code mousemap) (byte-code "´    A\"AÇ" [code mousemap assq] 3))
  174.  
  175. (defun mouse-lookup (mouse-code) "\
  176. Look up MOUSE-EVENT and return the definition. nil means undefined." (byte-code "ˆ    \"Å ˆ
  177. \"Ç" [mouse-code current-local-mousemap current-global-mousemap mousemap-get] 4))
  178.  
  179. (defun mouse-mask-lookup (mask list) "\
  180. Args MASK (a bit mask) and LIST (a list of (code . form) pairs).
  181. Returns a list of elements of LIST whose code or'ed with MASK is non-zero." (byte-code "ˋ
  182. Ę
  183. @@\"Ä
  184. @BÉÈ
  185. AÉÈÁÈ)Ç" [result nil list mask logtest] 4))
  186.  
  187. (defun mouse-union (l l-unique) "\
  188. Return the union of list of mouse (code . form) pairs L and L-UNIQUE,
  189. where L-UNIQUE is considered to be union'ized already." (byte-code "    
  190. Ä!
  191. @˜ @\"?Ä BÉ)È
  192. AÉÈÁÈ)Ç" [result l-unique l code-form-pair assq] 4))
  193.  
  194. (defun mouse-union-first-prefered (l1 l2) "\
  195. Return the union of lists of mouse (code . form) pairs L1 and L2,
  196. based on the code's, with preference going to elements in L1." (byte-code "ˆˆ    ´\"\"Ç" [l2 l1 nil mouse-union] 5))
  197.  
  198. (defun mouse-code-function-pairs-of-region (region) "\
  199. Return a list of (code . function) pairs, where each code is
  200. currently set in the REGION." (byte-code "˜    !¯˘
  201. A\"˘ A\"\")Ç" [mask region current-local-mousemap current-global-mousemap mouse-region-to-code mouse-union-first-prefered mouse-mask-lookup] 7))
  202.  
  203. (defun one-line-doc-string (function) "\
  204. Returns first line of documentation string for FUNCTION.
  205. If there is no documentation string, then the string
  206. \"No documentation\" is returned." (byte-code ":Ä
  207. @ÉÈÁÈ´!    ?ˆÁ&˜¯    \"È    ˘˙˘!O)Ç" [function doc documentation "No documentation." string-match "^.*$" 0 match-end] 6))
  208.  
  209. (defun print-mouse-format (binding) (byte-code "ˋ@!Èˋ´!Ȉ˜A\"ȯ Èˋ˘!Èˋ˙@!!ȯ Ç" [binding princ ": " mapcar (lambda (mouse-list) (byte-code "ˋ!Èˋ´!Ç" [mouse-list princ " "] 3)) terpri "  " one-line-doc-string] 9))
  210.  
  211. (defun print-mouse-bindings (region) "\
  212. Prints mouse-event bindings for REGION." (byte-code "ˋ´ˆ!\"Ç" [region mapcar print-mouse-format em::event-bindings] 4))
  213.  
  214. (defun em::event-bindings (region) "\
  215. Returns an alist of (function . (mouse-list1 ... mouse-listN)) for REGION,
  216. where each mouse-list is bound to the function in REGION." (byte-code "˘    !ˆÄ:@˙ A
  217. \"
  218. Â$¨
  219. ² @!
  220. AB\"Á0 A² @!CB
  221. BÉ*ÈAÉÈÁÈ
  222. *Ç" [mouse-bindings region result nil code-function-pair current-entry mouse-code-function-pairs-of-region assoc setcdr mouse-code-to-mouse-list] 8))
  223.  
  224. (defun describe-mouse-bindings nil "\
  225. Lists all current mouse-event bindings." (interactive) (byte-code "¹Èˋдˆ!Ș È´¯!Ș È˘˙!Ș È´¨!Ș È´²!Ș È˘˚!Ș È´¸!Ș È´³!Ș È˘˝!ÑÇ" [nil "*Help*" princ "Text Region" terpri "---- ------" print-mouse-bindings text "Modeline Region" "-------- ------" modeline "Scrollbar Region" "--------- ------" scrollbar] 19))
  226.  
  227. (defun describe-mouse-briefly (mouse-list) "\
  228. Print a short description of the function bound to MOUSE-LIST." (interactive "xDescibe mouse list briefly: ") (byte-code "´Èˆ˜    !!¯˘    #Á¯˙    \")Ç" [function mouse-list nil mouse-lookup mouse-list-to-mouse-code message "%s runs the command %s" "%s is undefined"] 6))
  229.  
  230. (make-variable-buffer-local (quote current-local-mousemap))
  231.  
  232. (setq-default current-local-mousemap nil)
  233.  
  234. (defvar current-global-mousemap (make-mousemap))
  235.  
  236. (defun eterm-send-terminal-string-function (string function) "\
  237. Send a \\C-q quoted string to the terminal, then send function" (byte-code "´ˆ˜    R!Ç" [string function send-string-to-terminal "" ""] 5))
  238.  
  239. (defun eterm-change-title (title) "\
  240. Change the wm title for the gnumacs window." (interactive "sTitle: ") (byte-code "ˋÈ´ˆ\"Ç" [title nil eterm-send-terminal-string-function "t"] 3))
  241.  
  242. (defun eterm-send-region-to-cut-buffer nil "\
  243.    Copy the region between point and mark to the NeXT cut buffer.
  244.     This will not happen if the region contains a \\377." (interactive "") (byte-code "¹ÈÊˋ´ˆÏ)Ç" [nil err (byte-code "ˆ ˜ bȯ˘    ´#Â˙¨²\"È˚¸!Á#˙³    \"²\"*Ç" [start end t region-beginning region-end search-forward "" eterm-send-terminal-string-function "" "c" message "Bogus character in region." buffer-substring] 9) ((error (byte-code "¹ˋ´\"Ç" [eterm-send-terminal-string-function "" "c"] 3)))] 3))
  245.  
  246. (defun eterm-send-region-to-cut-buffer-and-wipe nil "\
  247.   As send-region-to-cut-buffer but also kill the text." (interactive "") (byte-code "¹Èˋ È´ Èˆ˜!Ç" [nil barf-if-buffer-read-only eterm-send-region-to-cut-buffer call-interactively kill-region] 4))
  248.  
  249. (defvar eserver nil "\
  250. The event server process.")
  251.  
  252. (defun start-event-server nil (interactive) (byte-code "˜È¯˘P!È˙¨!Ų˚!˙¸!Ų³!˝˛˜    ˇ
  253. !$É*È— ±\"ȼ ½\"Ⱦàá\"Ç" [emacs-version host port eserver nil eterm-change-title "Emacs version " getenv "EVENT_HOST" error "Can't find host for event server" "EVENT_PORT" "Can't find port for event server" open-network-stream " event-server" string-to-int set-process-filter event-filter set-process-sentinel event-sentinel global-set-key "" eterm-mouse-handler] 12))
  254.  
  255. (defun event-sentinel (process change) (byte-code "ˋ´P!Ç" [change message "The event handler has "] 3))
  256.  
  257. (defvar event-partial-output "" "\
  258. Incomplete, unprocessed output from the event server")
  259.  
  260. (defun event-filter (process string) (byte-code "    
  261. P˜¯\"Ä!˘˙!¨²!@!È ˚OÉ)ÈÁÈÉ)Ç" [events event-partial-output string next string-match "
  262. " match-end 0 eval read-from-string nil] 8))
  263.  
  264. (defun event-copy nil (byte-code "¹ Ç" [eterm-send-region-to-cut-buffer] 2))
  265.  
  266. (defun event-cut nil (byte-code "¹ Ç" [eterm-send-region-to-cut-buffer-and-wipe] 2))
  267.  
  268. (defun event-paste (str) (byte-code "ˋ È´`!ÈcÇ" [str barf-if-buffer-read-only push-mark] 3))
  269.  
  270. (defun event-quit nil (byte-code "ˋ ÈˋÉÇ" [last-command save-buffers-kill-emacs] 3))
  271.  
  272. (defconst cursor-pause-milliseconds 300 "\
  273. *Number of milliseconds to display alternate cursor (usually the mark)")
  274.  
  275. (defun indicate-region (&optional pause) "\
  276. Bounce cursor to mark for cursor-pause-milliseconds and back again" (byte-code "Å    ÉȈ˜ È¯˘!¢!Á˙¨!Ș )Ç" [pause cursor-pause-milliseconds times 0 exchange-point-and-mark fboundp sit-for-millisecs sit-for 1] 6))
  277.  
  278. (defun mouse-move-point (window x y) "\
  279. Move point to mouse cursor." (byte-code "¯!È˘    
  280. \"È ˙>ĨÉÇ" [window x y last-command this-command select-window move-to-loc (mouse-copy mouse-delete mouse-yank-move) mouse-yank-move] 4))
  281.  
  282. (defun mouse-set-mark (window x y) "\
  283. Set mark at mouse cursor." (byte-code "¯ ˘Î˙    !È`¨ \"Ȳ`!È
  284. bÈ˚ )))Ç" [OriginallySelectedWindow window point x y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window move-to-loc set-mark indicate-region] 6))
  285.  
  286. (defun mouse-set-mark-and-select (window x y) "\
  287. Set mark at mouse cursor, and select that window." (byte-code "ˆ!Ș    
  288. #Ç" [window x y select-window mouse-set-mark] 5))
  289.  
  290. (defvar *mouse-drag-window* nil)
  291.  
  292. (defvar *mouse-drag-x* -1)
  293.  
  294. (defvar *mouse-drag-y* -1)
  295.  
  296. (defun mouse-drag-move-point (window x y) "\
  297. Move point to mouse cursor, and allow dragging." (byte-code "˘    
  298. #È    
  299. ÉÇ" [window x y *mouse-drag-window* *mouse-drag-x* *mouse-drag-y* mouse-move-point] 4))
  300.  
  301. (defun mouse-drag-set-mark (window x y) "\
  302. The up click handler that goes with mouse-drag-move-point.
  303. If mouse is in same WINDOW but at different X or Y than when
  304. mouse-drag-move-point was last executed, set the mark at mouse." (byte-code "    =Ĩ
  305. \"Ĩ
  306. \"?²    
  307. #Á\"ÉÇ" [*mouse-drag-window* window *mouse-drag-x* x *mouse-drag-y* y this-command last-command equal mouse-set-mark-and-select] 6))
  308.  
  309. (defun mouse-select-or-drag-move-point (window x y) "\
  310. Select window if not selected, otherwise do mouse-drag-move-point." (byte-code "ˆ =˜    
  311. #Á¯    
  312. #Ç" [window x y selected-window mouse-drag-move-point mouse-select-window] 6))
  313.  
  314. (defun mouse-exch-pt-and-mark (window x y) "\
  315. Exchange point and mark." (byte-code "ˋ!È´ Ç" [window select-window exchange-point-and-mark] 3))
  316.  
  317. (defun mouse-call-kbd-macro (window x y) "\
  318. Invokes last keyboard macro at mouse cursor." (byte-code "ˆ    
  319. #Ș Ç" [window x y mouse-move-point call-last-kbd-macro] 4))
  320.  
  321. (defun mouse-mark-thing (window x y) "\
  322. Set point and mark to text object using syntax table.
  323. The resulting region is put in the NeXT pasteboard.
  324. Left or right Paren syntax marks an s-expression.  
  325. Clicking at the end of a line marks the line including a trailing newline.  
  326. If it doesn't recognize one of these it marks the character at point." (byte-code "˘    
  327. #ÈmÄ
  328. ˙¨!È`f² ! ˚=Â)¸¨!ȳ`!ȸ˝!Á[ ˛=Â5ˇ¨!Á[ —=ÂH±¨!Èˇ˝!ȼ Á[lÂW³`T!Ƚ¨!Á[³`T!Ⱦ *Ç" [window x y char syntax t mouse-move-point open-line 1 char-syntax 119 forward-word set-mark -1 40 mark-sexp 41 forward-char exchange-point-and-mark beginning-of-line indicate-region] 15))
  329.  
  330. (defun mouse-kill-thing (window x y) "\
  331. Kill thing at mouse, and put point there." (byte-code "ˆ    
  332. #Ș¯ ˘ \"Ç" [window x y mouse-mark-thing eterm-send-region-to-cut-buffer-and-wipe region-beginning region-end] 6))
  333.  
  334. (defun mouse-kill-thing-there (window x y) "\
  335. Kill thing at mouse, leave point where it was.
  336. See mouse-mark-thing for a description of the objects recognized." (byte-code "˜ ¯Î˘    !ÈÊ˙    
  337. #Ȩ² ˚ \")))Ç" [OriginallySelectedWindow window x y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window mouse-mark-thing eterm-send-region-to-cut-buffer-and-wipe region-beginning region-end] 8))
  338.  
  339. (defun mouse-save-thing (window x y &optional quiet) "\
  340. Put thing at mouse in kill ring.
  341. See mouse-mark-thing for a description of the objects recognized." (byte-code "˜    
  342. #ȯ˘ ˙ \"È ?Ĩ²!Ç" [window x y quiet mouse-mark-thing eterm-send-region-to-cut-buffer region-beginning region-end message "Thing saved"] 6))
  343.  
  344. (defun mouse-save-thing-there (window x y &optional quiet) "\
  345. Put thing at mouse in kill ring, leave point as is.
  346. See mouse-mark-thing for a description of the objects recognized." (byte-code "¯ ˘Î˙    !Èʨ    
  347. $)))Ç" [OriginallySelectedWindow window x y quiet selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window mouse-save-thing] 7))
  348.  
  349. (defun mouse-copy-thing (window x y) "\
  350. Put thing at mouse in kill ring, yank to point.
  351. See mouse-mark-thing for a description of the objects recognized." (byte-code "˘ÉÈ˙    
  352. ˜$Ȩ È¨ÉÇ" [last-command window x y t this-command not-kill mouse-save-thing-there yank] 5))
  353.  
  354. (defun mouse-move-thing (window x y) "\
  355. Kill thing at mouse, yank it to point.
  356. See mouse-mark-thing for a description of the objects recognized." (byte-code "¯ÉÈ˘    
  357. #È˙ È˙ÉÇ" [last-command window x y this-command not-kill mouse-kill-thing-there yank] 4))
  358.  
  359. (defun mouse-yank-at-point (&optional window x y) "\
  360. Yank from kill-ring at point; then cycle thru kill ring." (byte-code "˜=Â#`¯ W˘`¯ \"È˙¨!È
  361. @cÈ    Ä² )Á%˜ È˜ÉÇ" [last-command before kill-ring-yank-pointer this-command yank mark delete-region rotate-yank-pointer 1 exchange-point-and-mark] 8))
  362.  
  363. (defun mouse-yank-at-mouse (window x y) "\
  364. Yank from kill-ring at mouse; then cycle thru kill ring." (byte-code "ˆ    
  365. #Ș    
  366. #Ç" [window x y mouse-move-point mouse-yank-at-point] 5))
  367.  
  368. (defun mouse-save/delete/yank (&optional window x y) "\
  369. Context sensitive save/delete/yank.
  370. Consecutive clicks perform as follows:
  371.     * first click saves region to kill ring,
  372.     * second click kills region,
  373.     * third click yanks from kill ring,
  374.     * subsequent clicks cycle thru kill ring.
  375. If mouse-move-point is performed after the first or second click,
  376. the next click will do a yank, etc.  Except for a possible mouse-move-point,
  377. this command is insensitive to mouse location." (byte-code "ˆ> ˜ Á,¯=¢˙ ¨ \"ȲÉÁ,˚˙ ¨ \"ȸ³!ȯÉÇ" [last-command this-command t (mouse-delete yank mouse-yank-move) mouse-yank-at-point mouse-copy kill-region region-beginning region-end mouse-delete copy-region-as-kill message "Region saved"] 10))
  378.  
  379. (defun mouse-split-horizontally (window x y) "\
  380. Splits the window horizontally at mouse cursor." (byte-code "ˆ ˜Î¯    !È˘
  381. T!))Ç" [OriginallySelectedWindow window x selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window split-window-horizontally] 4))
  382.  
  383. (defun mouse-split-vertically (window x y) "\
  384. Split the window vertically at the mouse cursor." (byte-code "ˆ ˜Î¯    !È˘
  385. T!))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window split-window-vertically] 4))
  386.  
  387. (defun mouse-select-window (window x y) "\
  388. Selects the window, restoring point." (byte-code "ˋ!Ç" [window select-window] 2))
  389.  
  390. (defun mouse-delete-other-windows (window x y) "\
  391. Deletes all windows except the one mouse is in." (byte-code "ˋ!Ç" [window delete-other-windows] 2))
  392.  
  393. (defun mouse-delete-window (window x y) "\
  394. Deletes the window mouse is in." (byte-code "ˋ!Ç" [window delete-window] 2))
  395.  
  396. (defun mouse-undo (window x y) "\
  397. Invokes undo in the window mouse is in." (byte-code "´ ˆÎ˜    !ȯ ))Ç" [OriginallySelectedWindow window selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window undo] 4))
  398.  
  399. (defun mouse-scroll-up (window x y) "\
  400. Scrolls the window upward." (byte-code "ˆ ˜Î¯    !È˘˙!Ȩ´!))Ç" [OriginallySelectedWindow window nil selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window move-to-window-line 1 scroll-up] 5))
  401.  
  402. (defun mouse-scroll-down (window x y) "\
  403. Scrolls the window downward." (byte-code "ˆ ˜Î¯    !È˘´!))Ç" [OriginallySelectedWindow window nil selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-down] 4))
  404.  
  405. (defun mouse-scroll-proportional (window x y) "\
  406. Scrolls the window proportionally corresponding to window
  407. relative X divided by window width." (byte-code "ˆ ˜Î¯    !È
  408. ˘ SYÂdbÁ'e˙
  409. ¨deZ˘ S\"\"\\bȲ È˚ ))Ç" [OriginallySelectedWindow window x selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window window-width * / beginning-of-line what-cursor-position] 10))
  410.  
  411. (defun mouse-line-to-top (window x y) "\
  412. Scrolls the line at the mouse cursor up to the top." (byte-code "ˆ ˜Î¯    !È˘
  413. !))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-up] 4))
  414.  
  415. (defun mouse-top-to-line (window x y) "\
  416. Scrolls the top line down to the mouse cursor." (byte-code "ˆ ˜Î¯    !È˘
  417. !))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-down] 4))
  418.  
  419. (defun mouse-line-to-bottom (window x y) "\
  420. Scrolls the line at the mouse cursor to the bottom." (byte-code "ˆ ˜Î¯    !È˘
  421. ˙¨ Z\\!))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-up 2 window-height] 7))
  422.  
  423. (defun mouse-bottom-to-line (window x y) "\
  424. Scrolls the bottom line up to the mouse cursor." (byte-code "ˆ ˜Î¯    !È˘
  425. ˙¨ Z\\!))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-down 2 window-height] 7))
  426.  
  427. (defun mouse-line-to-middle (window x y) "\
  428. Scrolls the line at the mouse cursor to the middle." (byte-code "ˆ ˜Î¯    !È˘˙
  429. ¨²˚ ¸\"#!))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-up - -1 / window-height 2] 10))
  430.  
  431. (defun mouse-middle-to-line (window x y) "\
  432. Scrolls the line at the middle to the mouse cursor." (byte-code "ˆ ˜Î¯    !È˘˙¨² ˚\"
  433. ¸#!))Ç" [OriginallySelectedWindow window y selected-window ((byte-code "ˋ!Ç" [OriginallySelectedWindow select-window] 2)) select-window scroll-up - / window-height 2 1] 9))
  434.  
  435. (defun mini-move-point (window x y) (byte-code "´    ˆZ˜#Ç" [window x mouse-move-point 6 0] 4))
  436.  
  437. (defun mini-set-mark-and-select (window x y) (byte-code "´    ˆZ˜#Ç" [window x mouse-set-mark-and-select 6 0] 4))
  438.  
  439. (defun Buffer-at-mouse (w x y) "\
  440. Calls Buffer-menu-buffer from mouse click." (byte-code "˜ËÇ" [w x y t ((byte-code "˜    
  441. #ȯ È˘ˆ!Ç" [w x y t mouse-move-point beginning-of-line Buffer-menu-buffer] 4))] 1))
  442.  
  443. (defun mouse-buffer-bury (w x y) "\
  444. Bury the indicated buffer." (byte-code "ˆ˜    
  445. #!Ç" [w x y bury-buffer Buffer-at-mouse] 5))
  446.  
  447. (defun mouse-buffer-select (w x y) "\
  448. Put the indicated buffer in selected window." (byte-code "ˆ˜    
  449. #!ȯ Ç" [w x y switch-to-buffer Buffer-at-mouse list-buffers] 5))
  450.  
  451. (defun mouse-buffer-delete (w x y) "\
  452. mark indicated buffer for delete" (byte-code "ˆËÇ" [w x y ((byte-code "ˆ    
  453. #Ș Ç" [w x y mouse-move-point Buffer-menu-delete] 4))] 1))
  454.  
  455. (defun mouse-buffer-execute (w x y) "\
  456. execute buffer-menu selections" (byte-code "ˆËÇ" [w x y ((byte-code "ˆ    
  457. #Ș Ç" [w x y mouse-move-point Buffer-menu-execute] 4))] 1))
  458.  
  459. (defun enable-mouse-in-buffer-list nil "\
  460. Call this to enable mouse selections in *Buffer List*
  461.     LEFT puts the indicated buffer in the selected window.
  462.     SHIFT-LEFT buries the indicated buffer.
  463.     RIGHT marks the indicated buffer for deletion.
  464.     SHIFT-RIGHT deletes the marked buffers.
  465. To unmark a buffer marked for deletion, select it with LEFT." (byte-code "¹ËÇ" [((byte-code "¹ ÈˋqÈ´ˆ˜\"È´¯˘\"È´˙¨\"È´²˚\"Ç" [list-buffers "*Buffer List*" local-set-mouse (text shift left) mouse-buffer-bury (text left) mouse-buffer-select (text right) mouse-buffer-delete (text shift right) mouse-buffer-execute] 7))] 1))
  466.  
  467. (global-set-mouse (quote (text left)) (quote mouse-drag-move-point))
  468.  
  469. (global-set-mouse (quote (text up left)) (quote mouse-drag-set-mark))
  470.  
  471. (global-set-mouse (quote (text shift left)) (quote mouse-exch-pt-and-mark))
  472.  
  473. (global-set-mouse (quote (text right)) (quote mouse-set-mark-and-select))
  474.  
  475. (global-set-mouse (quote (text shift right)) (quote mouse-save/delete/yank))
  476.  
  477. (global-set-mouse (quote (text control right)) (quote mouse-save-thing-there))
  478.  
  479. (global-set-mouse (quote (text control left)) (quote mouse-yank-at-point))
  480.  
  481. (global-set-mouse (quote (text meta left)) (quote mouse-line-to-top))
  482.  
  483. (global-set-mouse (quote (text meta shift left)) (quote mouse-line-to-bottom))
  484.  
  485. (global-set-mouse (quote (text meta right)) (quote mouse-top-to-line))
  486.  
  487. (global-set-mouse (quote (text meta shift right)) (quote mouse-bottom-to-line))
  488.  
  489. (global-set-mouse (quote (text meta control left)) (quote mouse-call-kbd-macro))
  490.  
  491. (global-set-mouse (quote (text meta control right)) (quote mouse-undo))
  492.  
  493. (global-set-mouse (quote (scrollbar left)) (quote mouse-line-to-top))
  494.  
  495. (global-set-mouse (quote (scrollbar shift left)) (quote mouse-line-to-bottom))
  496.  
  497. (global-set-mouse (quote (scrollbar right)) (quote mouse-top-to-line))
  498.  
  499. (global-set-mouse (quote (scrollbar shift right)) (quote mouse-bottom-to-line))
  500.  
  501. (global-set-mouse (quote (scrollbar meta left)) (quote mouse-line-to-top))
  502.  
  503. (global-set-mouse (quote (scrollbar meta shift left)) (quote mouse-line-to-bottom))
  504.  
  505. (global-set-mouse (quote (scrollbar meta right)) (quote mouse-top-to-line))
  506.  
  507. (global-set-mouse (quote (scrollbar meta shift right)) (quote mouse-bottom-to-line))
  508.  
  509. (global-set-mouse (quote (modeline left)) (quote mouse-scroll-up))
  510.  
  511. (global-set-mouse (quote (modeline meta left)) (quote mouse-select-window))
  512.  
  513. (global-set-mouse (quote (modeline right)) (quote mouse-scroll-down))
  514.  
  515. (global-set-mouse (quote (modeline meta right)) (quote mouse-select-window))
  516.  
  517. (global-set-mouse (quote (modeline control left)) (quote mouse-delete-other-windows))
  518.  
  519. (global-set-mouse (quote (modeline control right)) (quote mouse-delete-window))
  520.  
  521. (global-set-mouse (quote (modeline control left right)) (quote mouse-select-window))
  522.  
  523. (global-set-mouse (quote (modeline left right)) (quote mouse-select-window))
  524.  
  525. (global-set-mouse (quote (minibuffer left)) (quote mini-move-point))
  526.  
  527. (global-set-mouse (quote (minibuffer right)) (quote mini-set-mark-and-select))
  528.  
  529. (global-set-mouse (quote (minibuffer shift left)) (quote (previous-complex-command 1)))
  530.  
  531. (global-set-mouse (quote (minibuffer control left)) (quote (next-complex-command 1)))
  532.  
  533. (global-set-mouse (quote (minibuffer shift right)) (quote (next-complex-command 1)))
  534.  
  535. (global-set-mouse (quote (minibuffer control right)) (quote (previous-complex-command 1)))
  536.